<?php
declare(strict_types=1);

namespace App\Controller;
class BaseController
{
    public function response($code, $msg = '', $data = '')
    {
        if (is_array($msg)) {
            $msg = implode(' ', array_column($msg, 0));
        }

        return [
            'code'    => $code,
            'data'    => $data,
            'message' => $msg,
        ];
    }
}